package com.tao.listen.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName Consumer1
 * @Author HETAO
 * @Date 2020/5/5 21:59
 */
@Component
public class Consumer1 {
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void test(String msg) {
        System.out.println("消费者1:" + msg);
    }

    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void test2(String msg) {
        System.out.println("消费者2:" + msg);
    }
}
